<script>
	export default {
		onLaunch: function() {
			console.log('App Launch')
			uni.setStorageSync('heights', uni.getSystemInfoSync()['statusBarHeight'])
		},
		onShow: function() {
			uni.setStorageSync('heights', uni.getSystemInfoSync()['statusBarHeight'])
			const updateManager = uni.getUpdateManager();
			updateManager.onUpdateReady(function(res) {
				uni.showModal({
					title: '更新提示',
					content: '新版本已经准备好，是否重启应用？',
					showCancel: true,
					success(res) {
						if (res.confirm) {
							uni.clearStorageSync();
							updateManager.applyUpdate();
						}
					}
				});
			});
		},
		onHide: function() {
			console.log('App Hide')
		}
	}
</script>

<style lang="scss">
	body {
		background-color: #F7F7F7;
	}

	p {
		display: flex;

		align-items: baseline;
	}

	.box {
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	button {
		display: flex;
		justify-content: center;
		align-items: center;
	}

	.kong {
		margin-top: 80rpx;

		.img {
			width: 300rpx;
			height: 300rpx;
		}

		.text {
			color: #CCCCCC;
			text-align: center;
		}
	}
</style>